package com.framewiki.example.entity;

import java.time.LocalDateTime;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;

@Data
@Entity
@Table(name = "rms_authorization_codes")
public class RmsAuthorizationCodesEntity {

    /**
     * 授权码
     */
    public static final String CODE = "code";

    /**
     * 主键ID
     */
    @Id
    @Column(name = "id", unique = true)
    private String id;
    
    /**
     * 授权码
     */
    @Column(name = "code", unique = true)
    private String code;

    /**
     * 客户端ID
     */
    @Column(name = "client_id")
    private String clientId;

    /**
     * 重定向URI
     */
    @Column(name = "redirect_uri")
    private String redirectUri;

    /**
     * 发布时间
     */
    @Column(name = "issued_at")
    private LocalDateTime issuedAt;

    /**
     * 过期时间
     */
    @Column(name = "expiry_at")
    private LocalDateTime expiryAt;
}
